<!-- HTML header for doxygen 1.9.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>COMMONS-NET: commonsNet.SocketClient类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">COMMONS-NET
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classcommonsNet_1_1SocketClient.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="#pro-methods">Protected 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="#pri-methods">Private 成员函数</a> &#124;
<a href="#pri-attribs">Private 属性</a> &#124;
<a href="classcommonsNet_1_1SocketClient-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">commonsNet.SocketClient类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>SocketClient类提供客户端对象访问套接字所需的基本操作。打开套接字、关闭套接字、设置超时等。  
 <a href="classcommonsNet_1_1SocketClient.html#details">更多...</a></p>
<div class="dynheader">
类 commonsNet.SocketClient 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classcommonsNet_1_1SocketClient.png" usemap="#commonsNet.SocketClient_map" alt=""/>
  <map id="commonsNet.SocketClient_map" name="commonsNet.SocketClient_map">
<area href="classcommonsNet_1_1bsd_1_1RExecClient.html" title="RExecClient实现了在4.2BSD Unix中的rexec()功能。" alt="commonsNet.bsd.RExecClient" shape="rect" coords="255,56,500,80"/>
<area href="classcommonsNet_1_1chargen_1_1CharGenTCPClient.html" title="CharGenTCPClient类是RFC 864中描述的字符生成器协议的客户端的TCP实现。" alt="commonsNet.chargen.CharGenTCPClient" shape="rect" coords="255,112,500,136"/>
<area href="classcommonsNet_1_1daytime_1_1DaytimeTCPClient.html" title="DaytimeTCPClient 类是 Daytime 协议（在 RFC 867 中描述）的 TCP 客户端实现。" alt="commonsNet.daytime.DaytimeTCPClient" shape="rect" coords="255,168,500,192"/>
<area href="classcommonsNet_1_1discard_1_1DiscardTCPClient.html" title="DiscardTCPClient 类是实现了 RFC 863 中描述的 Discard 协议的 TCP 客户端。" alt="commonsNet.discard.DiscardTCPClient" shape="rect" coords="255,224,500,248"/>
<area href="classcommonsNet_1_1finger_1_1FingerClient.html" title="finger客户端" alt="commonsNet.finger.FingerClient" shape="rect" coords="255,280,500,304"/>
<area href="classcommonsNet_1_1ftp_1_1FTP.html" title="FTP 扩展了 SocketClient ，提供了实现 FTP 客户端所需的基本功能。" alt="commonsNet.ftp.FTP" shape="rect" coords="255,336,500,360"/>
<area href="classcommonsNet_1_1imap_1_1IMAP.html" title="IMAP类提供了实现IMAP客户端所需的基本功能。" alt="commonsNet.imap.IMAP" shape="rect" coords="255,392,500,416"/>
<area href="classcommonsNet_1_1nntp_1_1NNTP.html" title="NNTP的基本功能。" alt="commonsNet.nntp.NNTP" shape="rect" coords="255,448,500,472"/>
<area href="classcommonsNet_1_1pop3_1_1POP3.html" title="POP3基本功能。" alt="commonsNet.pop3.POP3" shape="rect" coords="255,504,500,528"/>
<area href="classcommonsNet_1_1smtp_1_1SMTP.html" title="SMTP类提供实现SMTP客户端所需的基本功能，提供一组与命令名称对应的方法以便于实现SMTP客户端。" alt="commonsNet.smtp.SMTP" shape="rect" coords="255,560,500,584"/>
<area href="classcommonsNet_1_1telnet_1_1Telnet.html" title="实现Telnet的基本功能。" alt="commonsNet.telnet.Telnet" shape="rect" coords="255,616,500,640"/>
<area href="classcommonsNet_1_1time_1_1TimeTCPClient.html" title="TimeTCPClient 类是基于 TCP 的时间协议客户端实现，遵循 RFC 868 规范。" alt="commonsNet.time.TimeTCPClient" shape="rect" coords="255,672,500,696"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a1bb898df45d7b393d6c2814753b05be3"><td class="memItemLeft" align="right" valign="top">public&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a1bb898df45d7b393d6c2814753b05be3">init</a> ()</td></tr>
<tr class="memdesc:a1bb898df45d7b393d6c2814753b05be3"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认构造函数  <br /></td></tr>
<tr class="separator:a1bb898df45d7b393d6c2814753b05be3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87551917056355777424650106857aaa"><td class="memItemLeft" align="right" valign="top">public mut prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a87551917056355777424650106857aaa">readTimeout</a> : ?Duration</td></tr>
<tr class="separator:a87551917056355777424650106857aaa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1bc17afff65b64aa296c3b55ada867ef"><td class="memItemLeft" align="right" valign="top">public mut prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a1bc17afff65b64aa296c3b55ada867ef">writeTimeout</a> : ?Duration</td></tr>
<tr class="separator:a1bc17afff65b64aa296c3b55ada867ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6356afd60138e32bd7b05c8be35149d6"><td class="memItemLeft" align="right" valign="top">public prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a6356afd60138e32bd7b05c8be35149d6">remoteAddress</a> : IPAddress</td></tr>
<tr class="memdesc:a6356afd60138e32bd7b05c8be35149d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">客户端连接到的远程地址。委托给<code><a class="el" href="">StreamingSocket#remoteAddress</a></code>  <br /></td></tr>
<tr class="separator:a6356afd60138e32bd7b05c8be35149d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48b65614c29c5816bddc0c0b6d9bf2df"><td class="memItemLeft" align="right" valign="top">public prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a48b65614c29c5816bddc0c0b6d9bf2df">remotePort</a> : UInt16</td></tr>
<tr class="memdesc:a48b65614c29c5816bddc0c0b6d9bf2df"><td class="mdescLeft">&#160;</td><td class="mdescRight">客户端连接到的远程主机的端口号  <br /></td></tr>
<tr class="separator:a48b65614c29c5816bddc0c0b6d9bf2df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93a0598e2a9e67a8cd12779a30d65142"><td class="memItemLeft" align="right" valign="top">public prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a93a0598e2a9e67a8cd12779a30d65142">localAddress</a> : IPAddress</td></tr>
<tr class="memdesc:a93a0598e2a9e67a8cd12779a30d65142"><td class="mdescLeft">&#160;</td><td class="mdescRight">客户端套接字绑定到的本地地址。委托给<code><a class="el" href="">StreamingSocket#localAddress</a></code>  <br /></td></tr>
<tr class="separator:a93a0598e2a9e67a8cd12779a30d65142"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acfc16ab47c94037df62fb2ba9d027f1e"><td class="memItemLeft" align="right" valign="top">public prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#acfc16ab47c94037df62fb2ba9d027f1e">localPort</a> : UInt16</td></tr>
<tr class="memdesc:acfc16ab47c94037df62fb2ba9d027f1e"><td class="mdescLeft">&#160;</td><td class="mdescRight">客户端绑定到的本地端口号  <br /></td></tr>
<tr class="separator:acfc16ab47c94037df62fb2ba9d027f1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9044380b2d1dd34779216a935fa265c"><td class="memItemLeft" align="right" valign="top">public mut prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#af9044380b2d1dd34779216a935fa265c">defaultPort</a> : UInt16</td></tr>
<tr class="memdesc:af9044380b2d1dd34779216a935fa265c"><td class="mdescLeft">&#160;</td><td class="mdescRight">客户端应连接的默认端口。  <br /></td></tr>
<tr class="separator:af9044380b2d1dd34779216a935fa265c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c83df8caef820abcb2ab39ebeb3ffa7"><td class="memItemLeft" align="right" valign="top">public mut prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a0c83df8caef820abcb2ab39ebeb3ffa7">connectTimeout</a> : Duration</td></tr>
<tr class="memdesc:a0c83df8caef820abcb2ab39ebeb3ffa7"><td class="mdescLeft">&#160;</td><td class="mdescRight">连接超时时间，将传递给socket对象的connect方法。  <br /></td></tr>
<tr class="separator:a0c83df8caef820abcb2ab39ebeb3ffa7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a488725edabd4193aa85e999f834245"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a7a488725edabd4193aa85e999f834245">isConnected</a> (): Bool</td></tr>
<tr class="memdesc:a7a488725edabd4193aa85e999f834245"><td class="mdescLeft">&#160;</td><td class="mdescRight">如果套接字不是None，则返回true。  <br /></td></tr>
<tr class="separator:a7a488725edabd4193aa85e999f834245"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04e993f4f4374f378f9ddf730e7d1a1a"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a04e993f4f4374f378f9ddf730e7d1a1a">setSocketFactory</a> (socketFactory: ?<a class="el" href="classcommonsNet_1_1SocketFactory.html">SocketFactory</a>): Unit</td></tr>
<tr class="separator:a04e993f4f4374f378f9ddf730e7d1a1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4daf93a806b1a99d35e8b2d8394b2ff"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#ad4daf93a806b1a99d35e8b2d8394b2ff">setServerSocketFactory</a> (serverSocketFactory: ?<a class="el" href="classcommonsNet_1_1ServerSocketFactory.html">ServerSocketFactory</a>): Unit</td></tr>
<tr class="separator:ad4daf93a806b1a99d35e8b2d8394b2ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0fbcc57fadf7e3f7b9061232f3bc6303"><td class="memItemLeft" align="right" valign="top">public open func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a0fbcc57fadf7e3f7b9061232f3bc6303">connect</a> (address: String): Unit</td></tr>
<tr class="memdesc:a0fbcc57fadf7e3f7b9061232f3bc6303"><td class="mdescLeft">&#160;</td><td class="mdescRight">连接到远程主机  <br /></td></tr>
<tr class="separator:a0fbcc57fadf7e3f7b9061232f3bc6303"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a641075d2637ea7141ee2a535d922ef47"><td class="memItemLeft" align="right" valign="top">public open func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a641075d2637ea7141ee2a535d922ef47">connect</a> (address: String, port: UInt16): Unit</td></tr>
<tr class="memdesc:a641075d2637ea7141ee2a535d922ef47"><td class="mdescLeft">&#160;</td><td class="mdescRight">连接到远程主机  <br /></td></tr>
<tr class="separator:a641075d2637ea7141ee2a535d922ef47"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a5e20f3c11d7648fe8e13bbbfecc685"><td class="memItemLeft" align="right" valign="top">public open func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a3a5e20f3c11d7648fe8e13bbbfecc685">connect</a> (address: String, port: UInt16, localAddress: Option&lt;SocketAddress&gt;): Unit</td></tr>
<tr class="memdesc:a3a5e20f3c11d7648fe8e13bbbfecc685"><td class="mdescLeft">&#160;</td><td class="mdescRight">连接到远程主机  <br /></td></tr>
<tr class="separator:a3a5e20f3c11d7648fe8e13bbbfecc685"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ea99f7b6db651e4209ec78e8055ad45"><td class="memItemLeft" align="right" valign="top">public open func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a1ea99f7b6db651e4209ec78e8055ad45">connect</a> (address: SocketAddress): Unit</td></tr>
<tr class="memdesc:a1ea99f7b6db651e4209ec78e8055ad45"><td class="mdescLeft">&#160;</td><td class="mdescRight">连接到远程主机  <br /></td></tr>
<tr class="separator:a1ea99f7b6db651e4209ec78e8055ad45"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0bfe81fc4e64ac8c8cb4b0982ea6ca7"><td class="memItemLeft" align="right" valign="top">public open func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#ac0bfe81fc4e64ac8c8cb4b0982ea6ca7">connect</a> (address: SocketAddress, localAddress: Option&lt;SocketAddress&gt;): Unit</td></tr>
<tr class="memdesc:ac0bfe81fc4e64ac8c8cb4b0982ea6ca7"><td class="mdescLeft">&#160;</td><td class="mdescRight">连接到远程主机  <br /></td></tr>
<tr class="separator:ac0bfe81fc4e64ac8c8cb4b0982ea6ca7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d49495a9b64c3e848a020b509dcfdc0"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a9d49495a9b64c3e848a020b509dcfdc0">addProtocolCommandListener</a> (listener: <a class="el" href="classcommonsNet_1_1ProtocolCommandListener.html">ProtocolCommandListener</a>): Unit</td></tr>
<tr class="memdesc:a9d49495a9b64c3e848a020b509dcfdc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">添加一个ProtocolCommandListener  <br /></td></tr>
<tr class="separator:a9d49495a9b64c3e848a020b509dcfdc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a644174b37f378552318c6b93e44ae0e3"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a644174b37f378552318c6b93e44ae0e3">removeProtocolCommandListener</a> (listener: <a class="el" href="classcommonsNet_1_1ProtocolCommandListener.html">ProtocolCommandListener</a>): Unit</td></tr>
<tr class="memdesc:a644174b37f378552318c6b93e44ae0e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">移除一个ProtocolCommandListener  <br /></td></tr>
<tr class="separator:a644174b37f378552318c6b93e44ae0e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a209c171637129b711301908fe5781329"><td class="memItemLeft" align="right" valign="top">public open func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a209c171637129b711301908fe5781329">disconnect</a> (): Unit</td></tr>
<tr class="memdesc:a209c171637129b711301908fe5781329"><td class="mdescLeft">&#160;</td><td class="mdescRight">端口socket连接。应该在完成使用后以及再次连接之前调用此方法。_socket_将设为None  <br /></td></tr>
<tr class="separator:a209c171637129b711301908fe5781329"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a174f159c659d115fbb46baace12215d7"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a174f159c659d115fbb46baace12215d7">verifyRemote</a> (socket: StreamingSocket)</td></tr>
<tr class="memdesc:a174f159c659d115fbb46baace12215d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">验证给定套接字的远端是否为当前SocketClient连接的同一主机。  <br /></td></tr>
<tr class="separator:a174f159c659d115fbb46baace12215d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:acf063b8bd9929825dc931fa75918df33"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#acf063b8bd9929825dc931fa75918df33">static let NETASCII_EOL</a> : String = &quot;\r\n&quot;</td></tr>
<tr class="memdesc:acf063b8bd9929825dc931fa75918df33"><td class="mdescLeft">&#160;</td><td class="mdescRight">大多数IETF协议使用的换行符，CRLF  <br /></td></tr>
<tr class="separator:acf063b8bd9929825dc931fa75918df33"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected 成员函数</h2></td></tr>
<tr class="memitem:afa2734bc5477eabf0599324d6ede038b"><td class="memItemLeft" align="right" valign="top">protected func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#afa2734bc5477eabf0599324d6ede038b">fireCommandSent</a> (command: String, message: String)</td></tr>
<tr class="memdesc:afa2734bc5477eabf0599324d6ede038b"><td class="mdescLeft">&#160;</td><td class="mdescRight">如果有任何监听器，则向他们发送命令的详细信息。  <br /></td></tr>
<tr class="separator:afa2734bc5477eabf0599324d6ede038b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9c596dad672de038df93ef77b63746f"><td class="memItemLeft" align="right" valign="top">protected open func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#ae9c596dad672de038df93ef77b63746f">fireReplyReceived</a> (replyCode: Int64, reply: String)</td></tr>
<tr class="memdesc:ae9c596dad672de038df93ef77b63746f"><td class="mdescLeft">&#160;</td><td class="mdescRight">如果有任何监听器，则向他们发送回复的详细信息。  <br /></td></tr>
<tr class="separator:ae9c596dad672de038df93ef77b63746f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5133836949f8b27b41a31473654c881"><td class="memItemLeft" align="right" valign="top">protected open func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#ab5133836949f8b27b41a31473654c881">_connectAction_</a> ()</td></tr>
<tr class="memdesc:ab5133836949f8b27b41a31473654c881"><td class="mdescLeft">&#160;</td><td class="mdescRight">由于存在较多的connect方法，因此提供_connectAction_方法作为在建立连接后立即执行某些操作的手段，而不是重新实现所有connect方法。  <br /></td></tr>
<tr class="separator:ab5133836949f8b27b41a31473654c881"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-attribs" name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:a3da898c3d3f8488cf8a498ce1147eaf7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a3da898c3d3f8488cf8a498ce1147eaf7">var _socket_</a> : ?StreamingSocket</td></tr>
<tr class="memdesc:a3da898c3d3f8488cf8a498ce1147eaf7"><td class="mdescLeft">&#160;</td><td class="mdescRight">连接使用的socket  <br /></td></tr>
<tr class="separator:a3da898c3d3f8488cf8a498ce1147eaf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7610863136db5773a465f7a4feb10cd5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a7610863136db5773a465f7a4feb10cd5">var _input_</a> : ?InputStream = None</td></tr>
<tr class="memdesc:a7610863136db5773a465f7a4feb10cd5"><td class="mdescLeft">&#160;</td><td class="mdescRight">socket输入流  <br /></td></tr>
<tr class="separator:a7610863136db5773a465f7a4feb10cd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60f2dfec175bdbd8f243aea7a7dae5ec"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a60f2dfec175bdbd8f243aea7a7dae5ec">var _output_</a> : ?OutputStream = None</td></tr>
<tr class="memdesc:a60f2dfec175bdbd8f243aea7a7dae5ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">socket输出流  <br /></td></tr>
<tr class="separator:a60f2dfec175bdbd8f243aea7a7dae5ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ae2f2d89af96526257357b68009b196"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a1ae2f2d89af96526257357b68009b196">var _hostname_</a> : ?String</td></tr>
<tr class="memdesc:a1ae2f2d89af96526257357b68009b196"><td class="mdescLeft">&#160;</td><td class="mdescRight">用于连接的主机名  <br /></td></tr>
<tr class="separator:a1ae2f2d89af96526257357b68009b196"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0eeb213da3426f5b5fe3b0341f628106"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a0eeb213da3426f5b5fe3b0341f628106">var _remoteSocketAddress_</a> : ?SocketAddress</td></tr>
<tr class="memdesc:a0eeb213da3426f5b5fe3b0341f628106"><td class="mdescLeft">&#160;</td><td class="mdescRight">用于连接的远程套接字地址。  <br /></td></tr>
<tr class="separator:a0eeb213da3426f5b5fe3b0341f628106"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a222ed7ff95066135d7427671c17cbb51"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a222ed7ff95066135d7427671c17cbb51">var _defaultPort_</a> : UInt16</td></tr>
<tr class="memdesc:a222ed7ff95066135d7427671c17cbb51"><td class="mdescLeft">&#160;</td><td class="mdescRight">客户端应连接的默认端口。  <br /></td></tr>
<tr class="separator:a222ed7ff95066135d7427671c17cbb51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a45e24f8b9f78f96b0e42499f5224c42a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a45e24f8b9f78f96b0e42499f5224c42a">var _socketFactory_</a> : <a class="el" href="classcommonsNet_1_1SocketFactory.html">SocketFactory</a></td></tr>
<tr class="separator:a45e24f8b9f78f96b0e42499f5224c42a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa278799518e05c3b7aeb28bcebb23375"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#aa278799518e05c3b7aeb28bcebb23375">var _serverSocketFactory_</a> : <a class="el" href="classcommonsNet_1_1ServerSocketFactory.html">ServerSocketFactory</a></td></tr>
<tr class="separator:aa278799518e05c3b7aeb28bcebb23375"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a839d81898a2aacfcf9bfd3b7b6f0ffb8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a839d81898a2aacfcf9bfd3b7b6f0ffb8">var _connectTimeout_</a> : Duration = DEFAULT_CONNECT_TIMEOUT</td></tr>
<tr class="memdesc:a839d81898a2aacfcf9bfd3b7b6f0ffb8"><td class="mdescLeft">&#160;</td><td class="mdescRight">连接超时时间  <br /></td></tr>
<tr class="separator:a839d81898a2aacfcf9bfd3b7b6f0ffb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57b01a4fe6374778b227c41a8a45b0e1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a57b01a4fe6374778b227c41a8a45b0e1">let _commandSupport</a> : <a class="el" href="classcommonsNet_1_1ProtocolCommandSupport.html">ProtocolCommandSupport</a></td></tr>
<tr class="memdesc:a57b01a4fe6374778b227c41a8a45b0e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">ProtocolCommandSupport对象，用于管理ProtocolCommandListeners的注册和ProtocolCommandEvents的触发。  <br /></td></tr>
<tr class="separator:a57b01a4fe6374778b227c41a8a45b0e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-methods" name="pri-methods"></a>
Private 成员函数</h2></td></tr>
<tr class="memitem:abd229a00ddd8d1fd287b868c894f0af8"><td class="memItemLeft" align="right" valign="top">private func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#abd229a00ddd8d1fd287b868c894f0af8">_connect</a> (address: SocketAddress, localAddress: Option&lt;SocketAddress&gt;)</td></tr>
<tr class="separator:abd229a00ddd8d1fd287b868c894f0af8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private 属性</h2></td></tr>
<tr class="memitem:a01ba27a51dc2f5c803efa649ad03d444"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1SocketClient.html#a01ba27a51dc2f5c803efa649ad03d444">static let DEFAULT_CONNECT_TIMEOUT</a> : Duration = Duration.millisecond * 60000</td></tr>
<tr class="memdesc:a01ba27a51dc2f5c803efa649ad03d444"><td class="mdescLeft">&#160;</td><td class="mdescRight">套接字的默认连接超时时间  <br /></td></tr>
<tr class="separator:a01ba27a51dc2f5c803efa649ad03d444"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>SocketClient类提供客户端对象访问套接字所需的基本操作。打开套接字、关闭套接字、设置超时等。 </p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a id="a1bb898df45d7b393d6c2814753b05be3" name="a1bb898df45d7b393d6c2814753b05be3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1bb898df45d7b393d6c2814753b05be3">&#9670;&#160;</a></span>init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public commonsNet.SocketClient.init </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>默认构造函数 </p>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="abd229a00ddd8d1fd287b868c894f0af8" name="abd229a00ddd8d1fd287b868c894f0af8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abd229a00ddd8d1fd287b868c894f0af8">&#9670;&#160;</a></span>_connect()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">private func commonsNet.SocketClient._connect </td>
          <td>(</td>
          <td class="paramname"><em>address</em>:&#160;</td>
          <td class="paramtype">SocketAddress, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em><a class="el" href="classcommonsNet_1_1SocketClient.html#a93a0598e2a9e67a8cd12779a30d65142">localAddress</a></em>:&#160;</td>
          <td class="paramtype">Option&lt;SocketAddress&gt;&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="ab5133836949f8b27b41a31473654c881" name="ab5133836949f8b27b41a31473654c881"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5133836949f8b27b41a31473654c881">&#9670;&#160;</a></span>_connectAction_()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">protected open func commonsNet.SocketClient._connectAction_ </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>由于存在较多的connect方法，因此提供_connectAction_方法作为在建立连接后立即执行某些操作的手段，而不是重新实现所有connect方法。 </p>

</div>
</div>
<a id="a9d49495a9b64c3e848a020b509dcfdc0" name="a9d49495a9b64c3e848a020b509dcfdc0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d49495a9b64c3e848a020b509dcfdc0">&#9670;&#160;</a></span>addProtocolCommandListener()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.SocketClient.addProtocolCommandListener </td>
          <td>(</td>
          <td class="paramname"><em>listener</em>:&#160;</td>
          <td class="paramtype">ProtocolCommandListener</td><td>)</td>
          <td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>添加一个ProtocolCommandListener </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">listener</td><td>要添加的ProtocolCommandListener </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a1ea99f7b6db651e4209ec78e8055ad45" name="a1ea99f7b6db651e4209ec78e8055ad45"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ea99f7b6db651e4209ec78e8055ad45">&#9670;&#160;</a></span>connect() <span class="overload">[1/5]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public open func commonsNet.SocketClient.connect </td>
          <td>(</td>
          <td class="paramname"><em>address</em>:&#160;</td>
          <td class="paramtype">SocketAddress</td><td>)</td>
          <td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>连接到远程主机 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>远端地址 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ac0bfe81fc4e64ac8c8cb4b0982ea6ca7" name="ac0bfe81fc4e64ac8c8cb4b0982ea6ca7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac0bfe81fc4e64ac8c8cb4b0982ea6ca7">&#9670;&#160;</a></span>connect() <span class="overload">[2/5]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public open func commonsNet.SocketClient.connect </td>
          <td>(</td>
          <td class="paramname"><em>address</em>:&#160;</td>
          <td class="paramtype">SocketAddress, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em><a class="el" href="classcommonsNet_1_1SocketClient.html#a93a0598e2a9e67a8cd12779a30d65142">localAddress</a></em>:&#160;</td>
          <td class="paramtype">Option&lt;SocketAddress&gt;&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>连接到远程主机 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>远端地址 </td></tr>
    <tr><td class="paramname">localAddress</td><td>绑定的本地地址 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a0fbcc57fadf7e3f7b9061232f3bc6303" name="a0fbcc57fadf7e3f7b9061232f3bc6303"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0fbcc57fadf7e3f7b9061232f3bc6303">&#9670;&#160;</a></span>connect() <span class="overload">[3/5]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public open func commonsNet.SocketClient.connect </td>
          <td>(</td>
          <td class="paramname"><em>address</em>:&#160;</td>
          <td class="paramtype">String</td><td>)</td>
          <td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>连接到远程主机 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>远程主机地址 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a641075d2637ea7141ee2a535d922ef47" name="a641075d2637ea7141ee2a535d922ef47"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a641075d2637ea7141ee2a535d922ef47">&#9670;&#160;</a></span>connect() <span class="overload">[4/5]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public open func commonsNet.SocketClient.connect </td>
          <td>(</td>
          <td class="paramname"><em>address</em>:&#160;</td>
          <td class="paramtype">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>port</em>:&#160;</td>
          <td class="paramtype">UInt16&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>连接到远程主机 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>远程主机地址 </td></tr>
    <tr><td class="paramname">port</td><td>远程主机端口 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3a5e20f3c11d7648fe8e13bbbfecc685" name="a3a5e20f3c11d7648fe8e13bbbfecc685"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3a5e20f3c11d7648fe8e13bbbfecc685">&#9670;&#160;</a></span>connect() <span class="overload">[5/5]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public open func commonsNet.SocketClient.connect </td>
          <td>(</td>
          <td class="paramname"><em>address</em>:&#160;</td>
          <td class="paramtype">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>port</em>:&#160;</td>
          <td class="paramtype">UInt16, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em><a class="el" href="classcommonsNet_1_1SocketClient.html#a93a0598e2a9e67a8cd12779a30d65142">localAddress</a></em>:&#160;</td>
          <td class="paramtype">Option&lt;SocketAddress&gt;&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>连接到远程主机 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>远程主机地址 </td></tr>
    <tr><td class="paramname">port</td><td>远程主机端口 </td></tr>
    <tr><td class="paramname">localAddress</td><td>绑定的本地地址 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a0c83df8caef820abcb2ab39ebeb3ffa7" name="a0c83df8caef820abcb2ab39ebeb3ffa7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c83df8caef820abcb2ab39ebeb3ffa7">&#9670;&#160;</a></span>connectTimeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public mut prop commonsNet.SocketClient.connectTimeout</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>连接超时时间，将传递给socket对象的connect方法。 </p>

</div>
</div>
<a id="af9044380b2d1dd34779216a935fa265c" name="af9044380b2d1dd34779216a935fa265c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af9044380b2d1dd34779216a935fa265c">&#9670;&#160;</a></span>defaultPort()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public mut prop commonsNet.SocketClient.defaultPort</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>客户端应连接的默认端口。 </p>

</div>
</div>
<a id="a209c171637129b711301908fe5781329" name="a209c171637129b711301908fe5781329"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a209c171637129b711301908fe5781329">&#9670;&#160;</a></span>disconnect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public open func commonsNet.SocketClient.disconnect </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>端口socket连接。应该在完成使用后以及再次连接之前调用此方法。_socket_将设为None </p>

</div>
</div>
<a id="afa2734bc5477eabf0599324d6ede038b" name="afa2734bc5477eabf0599324d6ede038b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afa2734bc5477eabf0599324d6ede038b">&#9670;&#160;</a></span>fireCommandSent()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">protected func commonsNet.SocketClient.fireCommandSent </td>
          <td>(</td>
          <td class="paramname"><em>command</em>:&#160;</td>
          <td class="paramtype">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>message</em>:&#160;</td>
          <td class="paramtype">String&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>如果有任何监听器，则向他们发送命令的详细信息。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">command</td><td>命令名称 </td></tr>
    <tr><td class="paramname">message</td><td>完整的消息，包含命令名称 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae9c596dad672de038df93ef77b63746f" name="ae9c596dad672de038df93ef77b63746f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae9c596dad672de038df93ef77b63746f">&#9670;&#160;</a></span>fireReplyReceived()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">protected open func commonsNet.SocketClient.fireReplyReceived </td>
          <td>(</td>
          <td class="paramname"><em>replyCode</em>:&#160;</td>
          <td class="paramtype">Int64, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramname"><em>reply</em>:&#160;</td>
          <td class="paramtype">String&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>如果有任何监听器，则向他们发送回复的详细信息。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">replyCode</td><td>从回复中提取的代码 </td></tr>
    <tr><td class="paramname">reply</td><td>完整的回复文本 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a7a488725edabd4193aa85e999f834245" name="a7a488725edabd4193aa85e999f834245"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a488725edabd4193aa85e999f834245">&#9670;&#160;</a></span>isConnected()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.SocketClient.isConnected </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Bool </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>如果套接字不是None，则返回true。 </p>
<dl class="section return"><dt>返回</dt><dd>如果套接字不是None，则返回true。 </dd></dl>

</div>
</div>
<a id="a93a0598e2a9e67a8cd12779a30d65142" name="a93a0598e2a9e67a8cd12779a30d65142"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93a0598e2a9e67a8cd12779a30d65142">&#9670;&#160;</a></span>localAddress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public prop commonsNet.SocketClient.localAddress</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>客户端套接字绑定到的本地地址。委托给<code><a class="el" href="">StreamingSocket#localAddress</a></code> </p>

</div>
</div>
<a id="acfc16ab47c94037df62fb2ba9d027f1e" name="acfc16ab47c94037df62fb2ba9d027f1e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acfc16ab47c94037df62fb2ba9d027f1e">&#9670;&#160;</a></span>localPort()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public prop commonsNet.SocketClient.localPort</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>客户端绑定到的本地端口号 </p>

</div>
</div>
<a id="a87551917056355777424650106857aaa" name="a87551917056355777424650106857aaa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a87551917056355777424650106857aaa">&#9670;&#160;</a></span>readTimeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public mut prop commonsNet.SocketClient.readTimeout</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a6356afd60138e32bd7b05c8be35149d6" name="a6356afd60138e32bd7b05c8be35149d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6356afd60138e32bd7b05c8be35149d6">&#9670;&#160;</a></span>remoteAddress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public prop commonsNet.SocketClient.remoteAddress</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>客户端连接到的远程地址。委托给<code><a class="el" href="">StreamingSocket#remoteAddress</a></code> </p>

</div>
</div>
<a id="a48b65614c29c5816bddc0c0b6d9bf2df" name="a48b65614c29c5816bddc0c0b6d9bf2df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a48b65614c29c5816bddc0c0b6d9bf2df">&#9670;&#160;</a></span>remotePort()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public prop commonsNet.SocketClient.remotePort</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>客户端连接到的远程主机的端口号 </p>

</div>
</div>
<a id="a644174b37f378552318c6b93e44ae0e3" name="a644174b37f378552318c6b93e44ae0e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a644174b37f378552318c6b93e44ae0e3">&#9670;&#160;</a></span>removeProtocolCommandListener()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.SocketClient.removeProtocolCommandListener </td>
          <td>(</td>
          <td class="paramname"><em>listener</em>:&#160;</td>
          <td class="paramtype">ProtocolCommandListener</td><td>)</td>
          <td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>移除一个ProtocolCommandListener </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">listener</td><td>要移除的ProtocolCommandListener </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ad4daf93a806b1a99d35e8b2d8394b2ff" name="ad4daf93a806b1a99d35e8b2d8394b2ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad4daf93a806b1a99d35e8b2d8394b2ff">&#9670;&#160;</a></span>setServerSocketFactory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.SocketClient.setServerSocketFactory </td>
          <td>(</td>
          <td class="paramname"><em>serverSocketFactory</em>:&#160;</td>
          <td class="paramtype">?ServerSocketFactory</td><td>)</td>
          <td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a04e993f4f4374f378f9ddf730e7d1a1a" name="a04e993f4f4374f378f9ddf730e7d1a1a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04e993f4f4374f378f9ddf730e7d1a1a">&#9670;&#160;</a></span>setSocketFactory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.SocketClient.setSocketFactory </td>
          <td>(</td>
          <td class="paramname"><em>socketFactory</em>:&#160;</td>
          <td class="paramtype">?SocketFactory</td><td>)</td>
          <td>: Unit </td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a174f159c659d115fbb46baace12215d7" name="a174f159c659d115fbb46baace12215d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a174f159c659d115fbb46baace12215d7">&#9670;&#160;</a></span>verifyRemote()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.SocketClient.verifyRemote </td>
          <td>(</td>
          <td class="paramname"><em>socket</em>:&#160;</td>
          <td class="paramtype">StreamingSocket</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>验证给定套接字的远端是否为当前SocketClient连接的同一主机。 </p>
<p>这对于在客户端需要接受来自服务器的连接时进行快速安全检查非常有用，例如FTP数据连接或BSD R command标准错误流。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>要检查的socket </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>如果远程主机相同，则为true，否则为false。 </dd></dl>

</div>
</div>
<a id="a1bc17afff65b64aa296c3b55ada867ef" name="a1bc17afff65b64aa296c3b55ada867ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1bc17afff65b64aa296c3b55ada867ef">&#9670;&#160;</a></span>writeTimeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public mut prop commonsNet.SocketClient.writeTimeout</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="a57b01a4fe6374778b227c41a8a45b0e1" name="a57b01a4fe6374778b227c41a8a45b0e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a57b01a4fe6374778b227c41a8a45b0e1">&#9670;&#160;</a></span>let _commandSupport</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.let _commandSupport : <a class="el" href="classcommonsNet_1_1ProtocolCommandSupport.html">ProtocolCommandSupport</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>ProtocolCommandSupport对象，用于管理ProtocolCommandListeners的注册和ProtocolCommandEvents的触发。 </p>

</div>
</div>
<a id="a01ba27a51dc2f5c803efa649ad03d444" name="a01ba27a51dc2f5c803efa649ad03d444"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a01ba27a51dc2f5c803efa649ad03d444">&#9670;&#160;</a></span>static let DEFAULT_CONNECT_TIMEOUT</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.static let DEFAULT_CONNECT_TIMEOUT : Duration = Duration.millisecond * 60000</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>套接字的默认连接超时时间 </p>

</div>
</div>
<a id="acf063b8bd9929825dc931fa75918df33" name="acf063b8bd9929825dc931fa75918df33"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf063b8bd9929825dc931fa75918df33">&#9670;&#160;</a></span>static let NETASCII_EOL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.static let NETASCII_EOL : String = &quot;\r\n&quot;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>大多数IETF协议使用的换行符，CRLF </p>

</div>
</div>
<a id="a839d81898a2aacfcf9bfd3b7b6f0ffb8" name="a839d81898a2aacfcf9bfd3b7b6f0ffb8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a839d81898a2aacfcf9bfd3b7b6f0ffb8">&#9670;&#160;</a></span>var _connectTimeout_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.var _connectTimeout_ : Duration = DEFAULT_CONNECT_TIMEOUT</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>连接超时时间 </p>

</div>
</div>
<a id="a222ed7ff95066135d7427671c17cbb51" name="a222ed7ff95066135d7427671c17cbb51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a222ed7ff95066135d7427671c17cbb51">&#9670;&#160;</a></span>var _defaultPort_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.var _defaultPort_ : UInt16</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>客户端应连接的默认端口。 </p>

</div>
</div>
<a id="a1ae2f2d89af96526257357b68009b196" name="a1ae2f2d89af96526257357b68009b196"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ae2f2d89af96526257357b68009b196">&#9670;&#160;</a></span>var _hostname_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.var _hostname_ : ?String</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>用于连接的主机名 </p>

</div>
</div>
<a id="a7610863136db5773a465f7a4feb10cd5" name="a7610863136db5773a465f7a4feb10cd5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7610863136db5773a465f7a4feb10cd5">&#9670;&#160;</a></span>var _input_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.var _input_ : ?InputStream = None</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>socket输入流 </p>

</div>
</div>
<a id="a60f2dfec175bdbd8f243aea7a7dae5ec" name="a60f2dfec175bdbd8f243aea7a7dae5ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60f2dfec175bdbd8f243aea7a7dae5ec">&#9670;&#160;</a></span>var _output_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.var _output_ : ?OutputStream = None</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>socket输出流 </p>

</div>
</div>
<a id="a0eeb213da3426f5b5fe3b0341f628106" name="a0eeb213da3426f5b5fe3b0341f628106"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0eeb213da3426f5b5fe3b0341f628106">&#9670;&#160;</a></span>var _remoteSocketAddress_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.var _remoteSocketAddress_ : ?SocketAddress</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>用于连接的远程套接字地址。 </p>

</div>
</div>
<a id="aa278799518e05c3b7aeb28bcebb23375" name="aa278799518e05c3b7aeb28bcebb23375"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa278799518e05c3b7aeb28bcebb23375">&#9670;&#160;</a></span>var _serverSocketFactory_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.var _serverSocketFactory_ : <a class="el" href="classcommonsNet_1_1ServerSocketFactory.html">ServerSocketFactory</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a3da898c3d3f8488cf8a498ce1147eaf7" name="a3da898c3d3f8488cf8a498ce1147eaf7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3da898c3d3f8488cf8a498ce1147eaf7">&#9670;&#160;</a></span>var _socket_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.var _socket_ : ?StreamingSocket</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>连接使用的socket </p>

</div>
</div>
<a id="a45e24f8b9f78f96b0e42499f5224c42a" name="a45e24f8b9f78f96b0e42499f5224c42a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a45e24f8b9f78f96b0e42499f5224c42a">&#9670;&#160;</a></span>var _socketFactory_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.SocketClient.var _socketFactory_ : <a class="el" href="classcommonsNet_1_1SocketFactory.html">SocketFactory</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>src/<a class="el" href="socket__client_8cj.html">socket_client.cj</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.9.6-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacecommonsNet.html">commonsNet</a></li><li class="navelem"><a class="el" href="classcommonsNet_1_1SocketClient.html">SocketClient</a></li>
    <li class="footer">制作者 <img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
